home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / Add-Ons / 4D / ComboBox 1.1.1 / ComboBox_FAQ.txt < prev    next >
Text File  |  1996-02-23  |  2KB  |  42 lines

  1.                        ComboBox 1.1.1
  2.                            Frequently Asked Questions
  3.  
  4.  
  5. Q:  Why does my database crash with a type 1 in CB_FillLst()?
  6.  
  7. a)  The external area may not exist.  External areas exist only while the layout that contains them is active.  For this reason, any ComboBox command that requires an external area as one of its parameters must be called from either the layout procedure, or from an object script.  (These commands may be called from global procedures as long as the global procedure is originally called from the layout procedure or an object script).
  8.  
  9. b)  The array may not be declared correctly.  Arrays passed to CB_FillLst() must be declared prior to calling CB_FillLst().  Also, they must be declared as a single-dimensioned array of type text:
  10.  
  11. ARRAY TEXT(MyArray;5)
  12.  
  13. c)  The array may be a local array.  Arrays passed to CB_FillLst() must be declared as either process or interprocess arrays.
  14.  
  15. d)  The array name may have been passed incorrectly.  Arrays passed to CB_FillLst() must be passed as a string:
  16.  
  17. CB_FillLst (MyCombo;"MyArray")
  18.   or
  19. CB_FillLst (MyCombo;"◊MyArray")
  20.   or
  21. CB_FillLst (MyCombo;"<>MyArray")
  22.  
  23.  
  24. Q:  Why do I get garbage from CB_GetTxt()?
  25.  
  26. In 4D, a text variable is a handle to another portion of memory that actually holds the text.  Until a value is assigned to the variable, the extra memory is not allocated.  Consider the following code:
  27.  
  28.   C_TEXT($vText)
  29.   CB_GetTxt (MyCombo;$vText)
  30.  
  31. At the point CB_GetTxt() is called, $vText has never had a value, so that extra memory remains unallocated.  As far as I know, there's no way I can take care of that from an external.
  32.  
  33. To take care of the problem, simply set $vText:="" before you call CB_GetTxt():
  34.  
  35.   C_TEXT($vText)
  36.   $vText:=""
  37.   CB_GetTxt (MyCombo;$vText)
  38.  
  39. Kinda cheesey, but it works.
  40.  
  41.  
  42.